package com.macro.mall.tiny.modules.pms.controller;


import com.macro.mall.tiny.common.api.CommonResult;
import com.macro.mall.tiny.modules.pms.model.PmsCalculatorFormula;
import com.macro.mall.tiny.modules.pms.service.PmsCalculatorFormulaService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 计算器公式 前端控制器
 * </p>
 *
 * @author tyrone
 * @since 2024-11-01
 */
@RestController
@RequestMapping("/pms/pmsCalculatorFormula")
@Api(tags = "PmsCalculatorFormulaController")
@Tag(name = "PmsCalculatorFormulaController", description = "计算器公式管理")
public class PmsCalculatorFormulaController {

    @Autowired
    private PmsCalculatorFormulaService pmsCalculatorFormulaService;

    @ApiOperation("根据id获取制定计算器的公式")
    @GetMapping("/getFormula")
    public CommonResult<PmsCalculatorFormula> getFormula(@RequestParam Integer calculatorId) {
        return CommonResult.success(pmsCalculatorFormulaService.query().eq("calculator_id",calculatorId).one());
    }
}

